name: linters

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

permissions:
  contents: read

jobs:
  golangci:
    name: golangci-lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: '1.21'
          cache: false
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v4
        with:
          version: latest
          args: --timeout=10m --out-format=colored-line-number --skip-dirs=yacc/console

  goimports:
    runs-on: ubuntu-latest
    name: goimports check
    steps:
      - name: checkout
        uses: actions/checkout@v4
      - name: goimports check
        uses: DarthBenro008/goimports-check-action@v0.1.0
        with:
          root-path: './' # The relative root path to run goimports
          excludes: "./yacc/"
